package com.toman.Adpter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.toman.R;
import com.toman.bean.LineEditTypeBean;

import java.util.List;

/**
 * Created by 邹苏隆 on 2018/4/27.
 * description：
 */

public class LineEditTypeAdapter extends AdapterBase<LineEditTypeBean, LineEditTypeHolder> {
    private LayoutInflater inflater;
    private Context mContext;

    public LineEditTypeAdapter(Context context) {
        inflater = LayoutInflater.from(context);
        this.mContext = context;

    }

    @Override
    protected void handlerData(List<LineEditTypeBean> mList2, int position, LineEditTypeHolder itemView) {
        LineEditTypeBean bean = mList2.get(position);
        itemView.tv_name.setText(bean.getName());
        itemView.tv_operator.setText(bean.getOperator());
        itemView.tv_time.setText(bean.getTime());
        itemView.tv_time_change.setText("换型时间：" + bean.getChangeTime());

    }


    @Override
    protected LineEditTypeHolder getItemViewHolder() {
        return new LineEditTypeHolder();
    }

    @Override
    protected View initConvertView(View convertView, LineEditTypeHolder v) {
        convertView = inflater.inflate(R.layout.item_list_type_history, null);
        v.tv_operator = (TextView) convertView
                .findViewById(R.id.tv_operator);
        v.tv_name = (TextView) convertView
                .findViewById(R.id.tv_title);
        v.tv_time = (TextView) convertView
                .findViewById(R.id.tv_time);
        v.tv_time_change = (TextView) convertView
                .findViewById(R.id.tv_time_change);
        return convertView;
    }

    @Override
    protected void onReachBottom() {

    }
}

class LineEditTypeHolder {
    public TextView tv_operator;
    public TextView tv_name;
    public TextView tv_time;
    public TextView tv_time_change;

}
